package org.mineground.commands.irc;

import org.jibble.pircbot.Colors;
import org.jibble.pircbot.User;
import org.mineground.Main;
import org.mineground.handlers.irc.CommandExecutor;
import org.mineground.handlers.irc.UserLevel;

public class NPlayers implements CommandExecutor {
    @Override
    public void onCommand(User sender, UserLevel level, String channel, String command, String args[]) {
	StringBuilder out = new StringBuilder();
	out.append(Colors.BOLD);
	out.append("Players: ");
	out.append(Colors.NORMAL);
	out.append(Main.getInstance().getServer().getOnlinePlayers().length);
	out.append("/");
	out.append(Main.getInstance().getServer().getMaxPlayers());

	Main.getInstance().getIRCHandler().sendMessage(channel, out.toString());
    }
}